package com.ultimatech.wxservice.combusiness.dao.impl;

import com.ultimatech.webappdemo.base.BaseDao;
import com.ultimatech.webappdemo.base.model.GongzhongHao;
import com.ultimatech.wxservice.combusiness.dao.IComBusinesDao;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by zhangleping on 2017/6/16.
 */
@Component
public class ComBusinesDaoImpl extends BaseDao implements IComBusinesDao {

    @Autowired
    public ComBusinesDaoImpl(SessionFactory sessionFactory) {
        super(sessionFactory);
    }

    @Override
    public List<GongzhongHao> getAllGongzhongHao() {
        return this.getTemplate().loadAll(GongzhongHao.class);
    }

    @Override
    public void saveGongzhongHao(GongzhongHao gongzhongHao) {
        this.getTemplate().saveOrUpdate(gongzhongHao);
    }
}
